package com.lhn;

import com.lhn.config.SpringConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;

import javax.sql.DataSource;

/**
 * @author lhn
 * @date 2024-08-19 16:54
 */

public class App13 {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(SpringConfig.class);
        DataSource dataSource = (DataSource) ctx.getBean("dataSource");
        System.out.println("dataSource is " + dataSource);
    }
}
